<?php
    $search = "";
    if (isset($this->search)) {
        $addLink="?search=".$this->search;
    } else {
        $addLink="";
    }
?>
    <ul class="pagenav">
    <?php if (isset($this->previous)): ?>              
        <li><a class="first" href="<?= $this->url(array('page' => $this->first, 'search' => $search), $this->route).$addLink; ?>"></a></li>
    <?php else: ?>                
        <li><a class="first"></a></li>
    <?php endif; ?>
    <?php if (isset($this->previous)): ?>              
    <li><a class="back" href="<?= $this->url(array('page' => $this->previous, 'search' => $search), $this->route).$addLink; ?>"></a></li>
    <?php else: ?>            
        <li><a class="back"></a></li>
    <?php endif; ?>
<?php
    foreach ($this->pagesInRange as $page){
        if ($page != $this->current){
?>
        <li><a class="href<?= $page ?>" href="<?= $this->url(array('page' => $page, 'search' => $search), $this->route).$addLink; ?>"><?= $page; ?></a></li>
<?php       
        }else{
?>
        <li class="active"><?= $page; ?></li>
<?php
        }
    }
?>
        <li>von&nbsp;&nbsp;<?= $this->last; ?></li> 
    <?php if (isset($this->next)): ?>
        <li><a class="next" href="<?= $this->url(array('page' => $this->next, 'search' => $search), $this->route).$addLink; ?>"></a></li>
    <?php else: ?>
        <li><a class="next"></a></li>
    <?php endif; ?>
    <?php if (isset($this->next)): ?>
        <li><a class="last" href="<?= $this->url(array('page' => $this->last, 'search' => $search), $this->route).$addLink; ?>"></a></li>
    <?php else: ?>            
        <li><a class="last"></a></li>
    <?php endif; ?>     
    </ul>
